package com.aaa.day113.demo2;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月03日9:37
 */
public class Test1 {
    public static void main(String[] args) {

        //无需参数类型
        Operator operator=(arr)->{
            int sum=0;
            for (int b:arr){
                sum+=b;
            }
            return sum;
        };
        fun(operator);
    }
    public  static void  fun(Operator operator){
        int sum[]={23,5,34,3};
        int sum1=operator.getSum(sum);
        System.out.println("sum1 = " + sum1);
    }
}
interface Operator{
    public int getSum(int[] arr);
}